
public class BuildPerson {

    public Player buildPlayer(String playerInfo) {
        String[] parts = playerInfo.split(" ");
        String playerName = parts[1];
        String playerTeam = parts[2];
        String playerNumber = parts[3];
        String playerAge = parts[4];

        return new Player(playerName, playerTeam, playerNumber, playerAge);
    }

    public Coach buildCoach(String coachInfo) {
        String[] parts = coachInfo.split(" ");
        String coachName = parts[1];
        String coachTeam = parts[2];
        String coachTitle = parts[3];

        return new Coach(coachName, coachTeam, coachTitle);
    }

}
